<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        let arr = [1, 3, 4, -1, -20];

        let arrs = arr.map(ele => ele >= 0 ? ele : Math.abs(ele));
        console.log(arr)
        console.log(arrs)



    </script>
</head>
<body>

</body>
</html>